<template>
    <a-modal :confirm-loading="modalOption.loading" :okText="modalOption.okText" @ok="modalOption.onOk"
             @cancel="modalOption.onCancel" :cancelText="modalOption.cancelText" :width="modalOption.width" :visible="visible"
             :title="modalOption.title">
        <a-spin tip="loading..." :spinning="loading">
            <div class="container">
                <a-form-model ref="formModel" :label-col="formOption.labelCol" :wrapper-col="formOption.wrapperCol"
                              :layout="formOption.layout" :label-align="formOption.labelAlign" :hide-required-mark="formOption.hideRequiredMark"
                              :rules="formOption.rules" :model="formOption.formData">
                    <div v-if="tabName =='前处理'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-date-picker v-model="date" :locale="locale" class="inputs" valueFormat="YYYY-MM-DD"></a-date-picker>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="班长" prop="shiftLeader">
                                                <a-select v-if="searchSource.memberList.length" class="inputs" allowClear v-model="formOption.formData.shiftLeader" placeholder="选择班长">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="品名" prop="productName">
                                                <a-select
                                                    v-if="formOption.formData.standard"
                                                    @change="productNameChange"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length && searchSource.productList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    
                                                    allowClear
                                                    v-model="formOption.formData.rawMaterialName"
                                                    @change="rawMaterialNameChange"
                                                    placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="药材来料批号" prop="rawMaterialBatchNumber">
                                                <a-popover title="药材来料批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>药材来料批号=药材分类码+物料码+原药材流水号</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{rawMaterialBatchNumber || '请选择药材分类码、物料码、原药材流水号'}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="药材分类码" prop="rawMaterialClassificationCode">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.rawMaterialClassificationCode" placeholder="选择药材分类码">
                                                    <a-select-option value="01">01</a-select-option>
                                                    <a-select-option value="02">02</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item  label="物料码" prop="materialCode">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.materialCode" placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材流水号" prop="rawMaterialSerialNumber">
                                                <div v-for="(item,i) in formOption.formData.rawMaterialSerialNumber" :key='i'>
                                                    <a-input
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    mode="multiple"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.rawMaterialSerialNumber[i]"
                                                    placeholder="原药材流水号">
                                                    </a-input>
                                                    <span v-else>请先选择标准和品名</span>
                                                    <a-button style="margin-left:10px" type="primary" @click="formOption.formData.rawMaterialSerialNumber.push('')">新增</a-button>
                                                    <a-button :disabled="formOption.formData.rawMaterialSerialNumber.length<=1" style="margin-left:10px" type="danger" @click="formOption.formData.rawMaterialSerialNumber.splice(i,1)">删除</a-button>
                                                </div>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>批号=生产类型+物料码+生产流水号+亚批</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{batchNumber || '请选择生产类型、物料码、生产流水号'}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型（CW/SY/G）" prop="productionType">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.productionType" placeholder="生产类型（CW/SY/G）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="亚批" prop="preDealBatch">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.preDealBatch" placeholder="亚批">
                                                    <a-select-option value="-1">-1</a-select-option>
                                                    <a-select-option value="-2">-2</a-select-option>
                                                    <a-select-option value="-3">-3</a-select-option>
                                                    <a-select-option value="-4">-4</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="总投料量(kg)" prop="totalInputAmount">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.totalInputAmount" placeholder="总投料量(kg)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="总产出量(kg)" prop="totalOutputAmount">
                                                <a-input  class="inputs" allowClear v-model="formOption.formData.totalOutputAmount" placeholder="总产出量(kg)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产地" prop="origin">
                                                <a-select
                                                    v-if="formOption.formData.productName"
                                                    class="inputs"
                                                    v-model="formOption.formData.origin"
                                                    placeholder="请选择">
                                                    <a-select-option v-for="(item,i) in searchSource.originOfProdList" :key="i" :value="item.value">{{item.value}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择原药材品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="当班投料量(kg)" prop="shiftInputAmount">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.shiftInputAmount" placeholder="当班投料量(kg)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="当班产出量(kg)" prop="shiftOutputAmount">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.shiftOutputAmount" placeholder="当班产出量(kg)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="细粉量(kg)" prop="finePowderAmount">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.finePowderAmount" placeholder="细粉量(kg)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="工序" prop="process">
                                                <a-select mode="multiple" class="inputs" allowClear v-model="formOption.formData.process" placeholder="选择工序">
                                                    <a-select-option value="切制">切制</a-select-option>
                                                    <a-select-option value="洗">洗</a-select-option>
                                                    <a-select-option value="榨汁">榨汁</a-select-option>
                                                    <a-select-option value="手工净制（剪铁丝)">手工净制（剪铁丝)</a-select-option>
                                                    <a-select-option value="手工切制">手工切制</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备" prop="equipment">
                                                <a-select mode="multiple" class="inputs" allowClear v-model="formOption.formData.equipment" placeholder="选择设备">
                                                    <a-select-option value="切破一体机机组">切破一体机机组</a-select-option>
                                                    <a-select-option value="电磁炒药机">电磁炒药机</a-select-option>
                                                    <a-select-option value="洗药机">洗药机</a-select-option>
                                                    <a-select-option value="转盘式切药">转盘式切药</a-select-option>
                                                    <a-select-option value="机榨汁机">机榨汁机</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="规格大小cm" prop="specificationSizeCm">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.specificationSizeCm" placeholder="规格大小cm"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row style="display:flex;align-items: center" v-for="(domain,d) in formOption.formData.auxiliaryMaterialNameTwo" :key="d">
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料名称" prop="auxiliaryMaterialName">
                                                <a-select v-if="formOption.formData.standard" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="domain.name" placeholder="选择辅料名称">
                                                    <a-select-option v-for="(item,i) in searchSource.accessoriesList" :key="i" :value="item.name">
                                                        {{item.name}}
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料量kg" prop="auxiliaryMaterialAmount">
                                                <a-input v-if="formOption.formData.standard" class="inputs" allowClear v-model="domain.value" placeholder="辅料量kg"></a-input>
                                                <span v-else>请选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-button style="margin-right: 5px" type="primary" @click="addAuxiliaryMaterialNameTwo">新增</a-button>
                                            <a-button type="danger" :disabled="formOption.formData.auxiliaryMaterialNameTwo.length==1" @click="delAuxiliaryMaterialNameTwo(d)">删除</a-button>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工时间" prop="startTime">
                                                <a-input-number class="inputs" v-model="formOption.formData.startTime"></a-input-number>
                                                <!--                                        <a-date-picker class="inputs" valueFormat="YYYY-MM-DD" v-model="formOption.formData.startTime" placeholder="开工时间" />-->
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="实际生产时间" prop="actualProductionTime">
                                                <a-input-number class="inputs" v-model="formOption.formData.actualProductionTime"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间" prop="clearingTime">
                                                <a-input-number class="inputs" v-model="formOption.formData.clearingTime"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="人员" prop="personnel">
                                                <a-input-number class="inputs" v-model="formOption.formData.personnel"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="工时" prop="workingHours">
                                                <a-popover title="工时">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>（开工时间+实际生产时间+清场时间）*人员</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{ workingHours || '请选择开工时间、实际生产时间、清场时间、人员' }}/小时</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="操作人" prop="operator">
                                                <a-select class="inputs" mode="multiple" allowClear v-model="formOption.formData.operator" placeholder="选择操作人">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备维修时间" prop="equipmentMaintenanceTime">
                                                <a-input-number class="inputs" v-model="formOption.formData.equipmentMaintenanceTime"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常情况" prop="abnormalCondition">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.abnormalCondition" placeholder="异常情况"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :row="2" class="inputs" v-model="formOption.formData.remarks"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='提取'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-date-picker v-model="date" :locale="locale" class="inputs" valueFormat="YYYY-MM-DD"></a-date-picker>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班长" prop="shiftLeader">
                                                <a-select v-if="searchSource.memberList.length" class="inputs" allowClear v-model="formOption.formData.shiftLeader" placeholder="选择班长">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    @change="productNameChange"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.rawMaterialName"
                                                    placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="来料批号" prop="rawMaterialBatchNumber">
                                                <a-popover title="来料批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>源于前处理批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    v-if="formOption.formData.productName && formOption.formData.standard"
                                                    mode="multiple"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs-with-qus"
                                                    v-model="formOption.formData.materialBatchNumber">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.batchNumber">{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准、品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="物料码" prop="materialCode">
                                                <a-select v-if="searchSource.originMaterialList.length" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="formOption.formData.materialCode" placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>批号=生产类型+物料码+生产流水号</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{batchNumberOfExtract || '请选择生产类型、物料码、生产流水号'}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.productionType" placeholder="（CW/SY/G/ZCW）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G','ZCW']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="煎煮(kg)" prop="boilingAmountKg">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.boilingAmountKg" placeholder="煎煮(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="二煎出液时间(h)" prop="secondBoilingOutputTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.secondBoilingOutputTime" placeholder="二煎出液时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="每锅投料量（kg)" prop="perPotInputAmountKg">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.perPotInputAmountKg" placeholder="每锅投料量（kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="投料量(kg)" prop="inputAmount">
                                                <a-input-number
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.inputAmount"
                                                    placeholder="投料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="累计投料量(kg)" prop="cumulativeInputAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.cumulativeInputAmount" placeholder="累计投料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="待料时间(min)" prop="waitingForMaterialTimeMin">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.waitingForMaterialTimeMin" placeholder="待料(等待投料)时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="待料原因" prop="waitingForMaterialReason">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.waitingForMaterialReason" placeholder="待料原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常时间(min)" prop="abnormalFailureShutdownTimeMin">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.abnormalFailureShutdownTimeMin" placeholder="异常(故障停产)时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常原因" prop="abnormalReason">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.abnormalReason" placeholder="异常原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="浓缩(kg)" prop="concentrationAmountKg">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.concentrationAmountKg" placeholder="浓缩(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="浓缩(h)" prop="concentrationTimeH">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.concentrationTimeH" placeholder="浓缩(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="出膏用时(h)" prop="pasteProductionTimeH">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.pasteProductionTimeH" placeholder="出膏用时(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="浓缩清场(h)" prop="concentrationClearingTimeH">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.concentrationClearingTimeH" placeholder="浓缩清场(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="出膏(kg)" prop="pasteOutputAmountKg">
                                                <a-input-number class="inputs" v-model="formOption.formData.pasteOutputAmountKg" placeholder="出膏(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场(kg)" prop="clearingAmountKg">
                                                <a-input-number class="inputs" v-model="formOption.formData.clearingAmountKg" placeholder="清场(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="待料原因" prop="waitingForMaterialReason2">
                                                <a-input class="inputs" v-model="formOption.formData.waitingForMaterialReason2" placeholder="待料原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常时间(min)" prop="abnormalNonNormalShutdownTimeMin">
                                                <a-input-number class="inputs" v-model="formOption.formData.abnormalNonNormalShutdownTimeMin" placeholder="异常(非正常停产)时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常原因" prop="abnormalReason2">
                                                <a-input class="inputs" v-model="formOption.formData.abnormalReason2" placeholder="异常原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :row="2"  class="inputs" v-model="formOption.formData.remarks"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='喷干'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-popover title="日期来源">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>日期来源于提取表日期</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{date}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    disabled
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班长" prop="shiftLeader">
                                                <a-select v-if="searchSource.memberList.length" class="inputs" allowClear v-model="formOption.formData.shiftLeader" placeholder="选择班长">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    @change="productNameChange"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    disabled
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    disabled
                                                    v-model="formOption.formData.rawMaterialName"
                                                    placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>源于提取的批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    disabled
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    class="inputs-with-qus"
                                                    v-model="formOption.formData.batchNumber"
                                                    @change="batchChange">
                                                    <a-select-option
                                                        v-for="(item,i) in searchSource.codeList"
                                                        :key="i" :value="item.batchNumber"
                                                    >{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="亚批" prop="secondBatch">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.secondBatch" placeholder="选择亚批">
                                                    <a-select-option value="-1">-1</a-select-option>
                                                    <a-select-option value="-2">-2</a-select-option>
                                                    <a-select-option value="-3">-3</a-select-option>
                                                    <a-select-option value="-4">-4</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="亚批批号" prop="secondBatchNumber">
                                                <a-popover title="亚批批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>批号+亚批</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{secondBatchNumber || "请先选择批号和亚批"}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="物料码" prop="materialCode">
                                                <a-select disabled v-if="searchSource.originMaterialList.length" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="formOption.formData.materialCode" placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span slot="title" style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select disabled class="inputs" allowClear v-model="formOption.formData.productionType" placeholder="（CW/SY/G/ZCW）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G','ZCW']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input disabled class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="接班浸膏量(液位mm)" prop="receptionExtractVolumeMm">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.receptionExtractVolumeMm" placeholder="接班浸膏量(液位mm)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="交班浸膏量(液位mm)" prop="handoverExtractVolumeMm">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.handoverExtractVolumeMm" placeholder="交班浸膏量(液位mm)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="本批开喷浸膏量" prop="batchSprayExtractVolumeMm">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.batchSprayExtractVolumeMm" placeholder="开喷浸膏量(液位mm)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="收粉量(kg)" prop="powderCollectionAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.powderCollectionAmount" placeholder="收粉量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工准备时间(min)" prop="startUpTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.startUpTime" placeholder="开工准备时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="喷干时间(h)" prop="sprayTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.sprayTime" placeholder="喷干时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row style="display:flex;align-items: center" v-for="(domain,d) in formOption.formData.dryAuxiliaryMaterials" :key="d">
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料名称" prop="auxiliaryMaterialName">
                                                <a-select v-if="formOption.formData.standard" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="domain.name" placeholder="选择辅料名称">
                                                    <a-select-option v-for="(item,i) in searchSource.accessoriesList" :key="i" :value="item.name">
                                                        {{item.name}}
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料量kg" prop="auxiliaryMaterialAmount">
                                                <a-input v-if="formOption.formData.standard" class="inputs" allowClear v-model="domain.value" placeholder="辅料量kg"></a-input>
                                                <span v-else>请选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-button style="margin-right: 5px" type="primary" @click="addDryAuxiliaryMaterials">新增</a-button>
                                            <a-button type="danger" :disabled="formOption.formData.dryAuxiliaryMaterials.length==1" @click="delDryAuxiliaryMaterials(d)">删除</a-button>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="配料罐投料(kg)" prop="tankFeedAmountKg">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.tankFeedAmountKg" placeholder="配料罐投料(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="配料罐过滤(kg)" prop="tankFilteredAmountKg">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.tankFilteredAmountKg" placeholder="配料罐过滤(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场(kg)" prop="clearingAmountKg">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingAmountKg" placeholder="清场(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间(小时)" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间(小时)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场次数" prop="clearingCount">
                                                <a-input-number class="inputs" v-model="formOption.formData.clearingCount" placeholder="清场次数"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="等待浸膏时间(min)" prop="waitingExtractTimeMin">
                                                <a-input-number class="inputs" v-model="formOption.formData.waitingExtractTimeMin" placeholder="待料(等待浸膏)时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="降温铲粉时间(min)" prop="coolingPowderTimeMin">
                                                <a-input-number class="inputs" v-model="formOption.formData.coolingPowderTimeMin" placeholder="降温铲粉时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清洗雾化器时间(min)" prop="atomizerCleaningTimeMin">
                                                <a-input-number class="inputs" v-model="formOption.formData.atomizerCleaningTimeMin" placeholder="清洗雾化器时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常时间(min)" prop="downtimeMin">
                                                <a-input-number class="inputs" v-model="formOption.formData.downtimeMin" placeholder="异常(故障停机)时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="异常原因" prop="abnormalReason">
                                                <a-input class="inputs" v-model="formOption.formData.abnormalReason" placeholder="异常原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="批合计产量(kg)" prop="totalBatchOutput">
                                                <a-input class="inputs" v-model="formOption.formData.totalBatchOutput" placeholder="批合计产量(kg)"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='过筛'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-popover title="日期来源">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>日期来源于提取表日期</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{date}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    disabled
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    @change="productNameChange"
                                                    disabled
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    disabled
                                                    v-model="formOption.formData.rawMaterialName"
                                                    placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>源于提取的批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    disabled
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    class="inputs-with-qus"
                                                    v-model="formOption.formData.batchNumber"
                                                    @change="batchChange">
                                                    <a-select-option
                                                        v-for="(item,i) in searchSource.codeList"
                                                        :key="i"
                                                        :value="item.batchNumber"
                                                    >{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="物料码" prop="materialCode">
                                                <a-select
                                                    disabled
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.materialCode"
                                                    placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span slot="title" style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select disabled class="inputs" allowClear v-model="formOption.formData.productionType" placeholder="（CW/SY/G/ZCW）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G','ZCW']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input disabled class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="粗粉量(kg)" prop="coarsePowderAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.coarsePowderAmount" placeholder="粗粉量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量(kg)" prop="totalOutputAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.totalOutputAmount" placeholder="产出量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="损耗(kg)" prop="loss">
                                                <a-popover title="损耗(kg)">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>粗粉量-产出量/kg</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{ loss || '请先填写粗粉量和产出量' }}/kg</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="麦芽糊精(kg)" prop="maltodextrin">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.maltodextrin" placeholder="麦芽糊精(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="其他辅料(kg)" prop="otherAdditives">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.otherAdditives" placeholder="其他辅料(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="件数" prop="quantity">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.quantity" placeholder="件数"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工准备时间(min)" prop="startUpTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.startUpTime" placeholder="开工准备时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产时间(h)" prop="productionTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionTime" placeholder="生产时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间(min)" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间(min)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产要求" prop="productionRequirements">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.productionRequirements" placeholder="生产要求"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='混一'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-popover title="日期来源">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>日期来源于提取表日期</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{date}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    disabled
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    @change="productNameChange"
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.rawMaterialName"
                                                    placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>源于提取的批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    allowClear
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    class="inputs-with-qus"
                                                    v-model="formOption.formData.batchNumber"
                                                    @change="mixOneBatchChange">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.batchNumber">{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="来料批号" prop="incomingBatchNumber">
                                                <a-popover title="来料批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>源于提取的批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    allowClear
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    v-if="formOption.formData.batchNumber"
                                                    class="inputs-with-qus"
                                                    v-model="formOption.formData.incomingBatchNumber">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.batchNumber">{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择批号</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="物料码" prop="materialCode">
                                                <a-select disabled v-if="formOption.formData.batchNumber" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="formOption.formData.materialCode" placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span slot="title" style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择批号</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select
                                                    disabled
                                                    v-if="formOption.formData.batchNumber"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productionType"
                                                    placeholder="（CW/SY/G/ZCW）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G','ZCW']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择批号</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input v-if="formOption.formData.batchNumber" disabled class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                                <span v-else>请先选择批号</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="投料量(kg)" prop="inputAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.inputAmount" placeholder="投料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="投料量件数" prop="inputNumber">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.inputNumber" placeholder="投料量件数"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料名称" prop="auxiliaryMaterialName">
                                                <a-select show-search :filter-option="$filterOption" class="inputs" allowClear v-model="formOption.formData.auxiliaryMaterialName" placeholder="选择辅料名称">
                                                    <a-select-option v-for="(item,i) in searchSource.accessoriesList" :key="i" :value="item.name">
                                                        {{item.name}}
                                                    </a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="预混物" prop="premix">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.premix" placeholder="预混物"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量(kg)" prop="totalOutputAmount" :rules="{required:true,trigger:'blur',message:'产出量不能为空'}">
                                                <a-input-number
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.totalOutputAmount"
                                                    placeholder="产出量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量件数" prop="outputNumber">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.outputNumber" placeholder="产出量件数"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工准备时间(h)" prop="startUpTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.startUpTime" placeholder="开工准备时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产时间(h)" prop="productionTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionTime" placeholder="生产时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间(h)" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="中途停机时间" prop="midwayDowntime">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.midwayDowntime" placeholder="（包含吃饭、休息等）"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备故障时间" prop="equipmentFailureTime">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.equipmentFailureTime" placeholder="设备故障时间"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="操作人" prop="operator">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.operator" placeholder="选择操作人">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注(GMP/NGP)" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注(GMP/NGP)"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='混二'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-date-picker v-model="date" :locale="locale" class="inputs" valueFormat="YYYY-MM-DD"></a-date-picker>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    @change="productNameChange"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear v-model="formOption.formData.rawMaterialName" placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="来料批号" prop="incomingBatchNumber">
                                                <a-popover title="来料批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>源于混一的批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    class="inputs-with-qus"
                                                    v-model="formOption.formData.incomingBatchNumber"
                                                    placeholder="请选择来料批号"
                                                    @change="mixTwoBatchChange">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.batchNumber">{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="亚批" prop="secondBatch">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.secondBatch" placeholder="选择亚批">
                                                    <a-select-option value="-1">-1</a-select-option>
                                                    <a-select-option value="-2">-2</a-select-option>
                                                    <a-select-option value="-3">-3</a-select-option>
                                                    <a-select-option value="-4">-4</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>批号=来料批号+亚批</h4>
                                                    </template>
                                                </a-popover>
                                                <span v-if="formOption.formData.incomingBatchNumber && formOption.formData.secondBatch">{{batchNumberOfMixTwo}}</span>
                                                <span v-else>请先选择来料批号和亚批</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="物料码" prop="materialCode">
                                                <a-select disabled v-if="formOption.formData.materialCode" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="formOption.formData.materialCode" placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span slot="title" style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择来料批号</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.productionType" placeholder="（CW/SY/G/ZCW）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G','ZCW']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row style="display:flex;align-items: center" v-for="(domain,d) in formOption.formData.mixTwoAuxiliaryMaterials" :key="d">
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料名称" prop="auxiliaryMaterialName">
                                                <a-select v-if="formOption.formData.standard" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="domain.name" placeholder="选择辅料名称">
                                                    <a-select-option v-for="(item,i) in searchSource.accessoriesList" :key="i" :value="item.name">
                                                        {{item.name}}
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="辅料量kg" prop="auxiliaryMaterialAmount">
                                                <a-input v-if="formOption.formData.standard" class="inputs" allowClear v-model="domain.value" placeholder="辅料量kg"></a-input>
                                                <span v-else>请选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-button style="margin-right: 5px" type="primary" @click="addMixTwoAuxiliaryMaterials">新增</a-button>
                                            <a-button type="danger" :disabled="formOption.formData.mixTwoAuxiliaryMaterials.length==1" @click="delMixTwoAuxiliaryMaterials(d)">删除</a-button>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="投料量(kg)" prop="inputAmount">
                                                <a-input-number
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.inputAmount"
                                                    placeholder="投料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="投料量件数" prop="inputNumber">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.inputNumber" placeholder="投料量件数"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="预混物" prop="premix">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.premix" placeholder="预混物"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="操作人" prop="operator">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.operator" placeholder="选择操作人">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量(kg)" prop="outputAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.totalOutputAmount" placeholder="产出量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量件数" prop="outputNumber">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.outputNumber" placeholder="产出量件数"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="混合方式" prop="mixingMethod">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.mixingMethod" placeholder="混合方式">
                                                    <a-select-option value="混粉">混粉</a-select-option>
                                                    <a-select-option value="混颗粒">混颗粒</a-select-option>
                                                    <a-select-option value="加挥发油">加挥发油</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工准备时间(h)" prop="startUpTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.startUpTime" placeholder="开工准备时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产时间(h)" prop="productionTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionTime" placeholder="生产时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间(h)" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="中途停机时间" prop="midwayDowntime">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.midwayDowntime" placeholder="（包含吃饭、休息等）"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备故障时间" prop="equipmentFailureTime">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.equipmentFailureTime" placeholder="设备故障时间"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        
                                        <a-col :span="6">
                                            <a-form-model-item label="备注(GMP/NGP)" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注(GMP/NGP)"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='制粒'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-popover title="日期来源">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>日期来源于混二表日期</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{date}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    disabled
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    @change="productNameChange"
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="原药材品名" prop="rawMaterialName">
                                                <a-select v-if="searchSource.originMaterialList.length" show-search :filter-option="$filterOption" class="inputs" allowClear v-model="formOption.formData.rawMaterialName" placeholder="选择原药材品名">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产批号" prop="productionBatch">
                                                <a-popover title="生产批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>生产批号来源于混二批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    class="inputs-with-qus"
                                                    allowClear
                                                    v-model="formOption.formData.productionBatch"
                                                    @change="productionBatchChange"
                                                    placeholder="选择生产批号">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.batchNumber">{{item.batchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="物料码" prop="materialCode">
                                                <a-select
                                                    disabled
                                                    v-if="searchSource.originMaterialList.length"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs" allowClear
                                                    v-model="formOption.formData.materialCode" placeholder="选择物料码">
                                                    <a-select-option v-for="(item,i) in searchSource.originMaterialList" :key="i" :value="item.code">
                                                        <span slot="title" style="color: #9e9e9e">{{item.name}}-</span>
                                                        <span slot="title" style="color: #d02804">{{item.code}}</span>
                                                    </a-select-option>
                                                </a-select>
                                                <span v-else>请先选择品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="亚批" prop="secondBatch">
                                                <a-select disabled class="inputs" allowClear v-model="formOption.formData.secondBatch" placeholder="选择亚批">
                                                    <a-select-option value="-1">-1</a-select-option>
                                                    <a-select-option value="-2">-2</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-popover title="批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>批号=物料码+生产流水号</h4>
                                                    </template>
                                                </a-popover>
                                                <span v-if="formOption.formData.productionBatch">{{zlBatchNumber}}</span>
                                                <span v-else>请先选择生产批号</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select disabled class="inputs" allowClear v-model="formOption.formData.productionType" placeholder="（CW/SY/G/ZCW）">
                                                    <a-select-option v-for="(item,i) in ['CW','SY','G','ZCW']" :key="i" :value="item">{{item}}</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产流水号" prop="productionSerialNumber">
                                                <a-input disabled class="inputs" allowClear v-model="formOption.formData.productionSerialNumber" placeholder="生产流水号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="投料量(kg)" prop="inputAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.inputAmount" placeholder="投料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="过筛量(kg)" prop="screeningAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.screeningAmount" placeholder="过筛量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="目标产量(kg)" prop="targetOutput">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.targetOutput" placeholder="目标产量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量(kg)" prop="totalOutputAmount" :rules="{required:true,trigger:'blur',message:'产出量不能为空'}">
                                                <a-input-number
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.totalOutputAmount"
                                                    placeholder="产出量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="累计产出量(kg)" prop="cumulativeOutput">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.cumulativeOutput" placeholder="累计产出量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="尾料(kg)" prop="tailMaterial">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.tailMaterial" placeholder="尾料(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="损耗(kg)" prop="loss">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.loss" placeholder="损耗(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工准备时间(h)" prop="startUpTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.startUpTime" placeholder="开工准备时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>

                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产时间(h)" prop="productionTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionTime" placeholder="生产时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="中途停机时间" prop="midwayDowntime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.midwayDowntime" placeholder="（包含吃饭、休息等）"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="消毒上器具(h)" prop="upAppliance">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.upAppliance" placeholder="消毒上器具(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="消毒下器具(h)" prop="downAppliance">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.downAppliance" placeholder="消毒下器具(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="中途停机原因" prop="midwayHaltCause">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.midwayHaltCause" placeholder="中途停机原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间(小时)" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间(小时)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备故障时间" prop="equipmentFailureTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.equipmentFailureTime" placeholder="设备故障时间"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="操作人" prop="operator">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.operator" placeholder="选择操作人">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="班长" prop="shiftLeader">
                                                <a-select v-if="searchSource.memberList.length" class="inputs" allowClear v-model="formOption.formData.shiftLeader" placeholder="选择班长">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='小袋分装'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-date-picker v-model="date" :locale="locale" class="inputs" valueFormat="YYYY-MM-DD"></a-date-picker>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select
                                                    v-if="formOption.formData.standard"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productionType"
                                                    placeholder="(C60/C80/C61/C81..)">
                                                    <a-select-option v-for="(item,i) in searchSource.productionTypeList" :key="i" :value="item.inventoryType">{{item.inventoryType}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productionType"
                                                    @change="productNameChange"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和生产类型</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="来料批号" prop="incomingBatchNumber">
                                                <a-popover title="来料批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>来料批号来源于制粒生产批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs-with-qus"
                                                    allowClear
                                                    v-model="formOption.formData.incomingBatchNumber"
                                                    placeholder="选择来料批号">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.productionBatch">{{item.productionBatch}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>

                                        <a-col :span="6">
                                            <a-form-model-item label="规格" prop="specification">
                                                <a-input disabled class="inputs" allowClear v-model="formOption.formData.specification" placeholder="规格"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="装量" prop="loadingQuantity">
                                                <a-input disabled class="inputs" allowClear v-model="formOption.formData.loadingQuantity" placeholder="装量"></a-input>
                                            </a-form-model-item>
                                        </a-col>

                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备编号" prop="equipmentId">
                                                <a-input class="inputs" v-model="formOption.formData.equipmentId" placeholder="设备编号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="成品批号" prop="finishedProductBatchNumber">
                                                <a-input class="inputs" v-model="formOption.formData.finishedProductBatchNumber" placeholder="成品批号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="理论袋数" prop="theoreticalBagCount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.theoreticalBagCount" placeholder="理论袋数"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="领料量(kg)" prop="materialInputAmount">
                                                <a-input-number
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.materialInputAmount"
                                                    placeholder="领料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="退料量(kg)" prop="materialReturnAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.materialReturnAmount" placeholder="退料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="尾料量(kg)" prop="tailMaterialAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.tailMaterialAmount" placeholder="尾料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="包材领用量(kg)" prop="packagingMaterialUsage">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.packagingMaterialUsage" placeholder="包材领用量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="包材退库量(kg)" prop="packagingMaterialReturn">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.packagingMaterialReturn" placeholder="包材退库量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="废包材量(kg)" prop="wastePackagingMaterial">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.wastePackagingMaterial" placeholder="废包材量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="包材净用量(kg)" prop="netPackagingUsage">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.netPackagingUsage" placeholder="包材净用量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出数量" prop="outputQuantity">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.outputQuantity" placeholder="产出数量"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="件数" prop="quantity">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.quantity" placeholder="件数"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="取样量" prop="samplingAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.samplingAmount" placeholder="取样量"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="打码产量" prop="codeYield">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.codeYield" placeholder="打码产量"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="准备时间" prop="preparationTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.preparationTime" placeholder="准备时间"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备故障时间" prop="equipmentFailureTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.equipmentFailureTime" placeholder="设备故障时间"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间（小时）" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间（小时）"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场备注" prop="clearingRemarks">
                                                <a-textarea :row="2" class="inputs" allowClear v-model="formOption.formData.clearingRemarks" placeholder="清场备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="设备运行时间(h)" prop="equipmentRuntime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.equipmentRuntime" placeholder="设备运行时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="停机时间(h)" prop="downtime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.downtime" placeholder="停机时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="中途停机原因" prop="downtimeReason">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.downtimeReason" placeholder="吃饭、停压缩空气、待料休息等"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备故障停机时间" prop="equipmentFailureDowntime">
                                                <a-input-number :row="2" class="inputs" allowClear v-model="formOption.formData.equipmentFailureDowntime" placeholder="等待和维修时间"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="故障原因" prop="failureReason">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.failureReason" placeholder="故障原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="操作人" prop="operator">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.operator" placeholder="选择操作人">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="班长" prop="shiftLeader">
                                                <a-select v-if="searchSource.memberList.length" class="inputs" allowClear v-model="formOption.formData.shiftLeader" placeholder="选择班长">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='大袋分装'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-date-picker v-model="date" :locale="locale" class="inputs" valueFormat="YYYY-MM-DD"></a-date-picker>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select
                                                    v-if="formOption.formData.standard"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productionType"
                                                    placeholder="(C60/C80/C61/C81..)">
                                                    <a-select-option v-for="(item,i) in searchSource.productionTypeList" :key="i" :value="item.inventoryType">{{item.inventoryType}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productionType"
                                                    show-search
                                                    @change="productNameChange"
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="来料批号" prop="incomingBatchNumber">
                                                <a-popover title="来料批号">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>来料批号来源于制粒生产批号</h4>
                                                    </template>
                                                </a-popover>
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs-with-qus"
                                                    allowClear
                                                    v-model="formOption.formData.incomingBatchNumber"
                                                    placeholder="选择来料批号">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.productionBatch">{{item.productionBatch}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班次" prop="shift">
                                                <a-select class="inputs" allowClear v-model="formOption.formData.shift" placeholder="选择班次">
                                                    <a-select-option value="白班">白班</a-select-option>
                                                    <a-select-option value="夜班">夜班</a-select-option>
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="装量" prop="loadingQuantity">
                                                <a-input disabled class="inputs" allowClear v-model="formOption.formData.loadingQuantity" placeholder="装量"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产量" prop="yield">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.yield" placeholder="产量"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备编号" prop="equipmentId">
                                                <a-input class="inputs" v-model="formOption.formData.equipmentId" placeholder="设备编号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="成品批号" prop="finishedProductBatchNumber">
                                                <a-input class="inputs" v-model="formOption.formData.finishedProductBatchNumber" placeholder="成品批号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产线" prop="productionLine">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.productionLine" placeholder="生产线"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="取样留样量" prop="samplingReservedSampleNumber">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.samplingReservedSampleNumber" placeholder="取样留样量"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="领料量(kg)" prop="materialInputAmount">
                                                <a-input-number
                                                    
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.materialInputAmount"
                                                    placeholder="领料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="退料量(kg)" prop="materialReturnAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.materialReturnAmount" placeholder="退料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="尾料量(kg)" prop="tailMaterialAmount">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.tailMaterialAmount" placeholder="尾料量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="包材领用量(kg)" prop="packagingMaterialUsage">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.packagingMaterialUsage" placeholder="包材领用量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="包材退库量(kg)" prop="packagingMaterialReturn">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.packagingMaterialReturn" placeholder="包材退库量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="废包材量(kg)" prop="wastePackagingMaterial">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.wastePackagingMaterial" placeholder="废包材量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="包材净用量(kg)" prop="netPackagingUsage">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.netPackagingUsage" placeholder="包材净用量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="开工准备时间" prop="startUpTime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.startUpTime" placeholder="开工准备时间"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备运行时间(h)" prop="equipmentRuntime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.equipmentRuntime" placeholder="设备运行时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场时间(h)" prop="clearingTimeNum">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.clearingTimeNum" placeholder="清场时间(h)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="打码产量" prop="codeYield">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.codeYield" placeholder="打码产量"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="清场备注" prop="clearingRemarks">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.clearingRemarks" placeholder="清场备注"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备故障停机时间" prop="equipmentFailureDowntime">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.equipmentFailureDowntime" placeholder="等待和维修时间"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="故障原因" prop="failureReason">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.failureReason" placeholder="故障原因"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="中途停机时间" prop="midwayDowntime">
                                                <a-input-number  class="inputs" allowClear v-model="formOption.formData.midwayDowntime" placeholder="包含吃饭、休息等"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item  label="中途停机原因" prop="downtimeReason">
                                                <a-input class="inputs" allowClear v-model="formOption.formData.downtimeReason" placeholder="吃饭、停压缩空气、待料休息等"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="设备操作人员" prop="equipmentOperationStaff">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.equipmentOperationStaffJson" placeholder="设备操作人员">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col  :span="6">
                                            <a-form-model-item label="摆单包人员" prop="swingPackStaff">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.swingPackStaffJson" placeholder="摆单包人员">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="包中包人员" prop="bagInBagStaff">
                                                <a-select v-if="formOption.formData.standard" class="inputs" mode="multiple" allowClear v-model="formOption.formData.bagInBagStaffJson" placeholder="包中包人员">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="班长" prop="shiftLeader">
                                                <a-select v-if="formOption.formData.standard" class="inputs" allowClear v-model="formOption.formData.shiftLeader" placeholder="班长">
                                                    <a-select-option v-for="(item,i) in searchSource.memberList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='小袋外包'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-popover title="日期来源">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>日期来源于小袋分装表日期</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{date}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    disabled
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="this.formOption.formData.standard"
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="房间编号" prop="roomNumber">
                                                <a-input allowClear class="inputs" v-model="formOption.formData.roomNumber" placeholder="房间编号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    show-search
                                                    disabled
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.batchNumber"
                                                    @change="batchChangeOfPacking"
                                                    placeholder="选择批号">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.finishedProductBatchNumber">{{item.finishedProductBatchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select
                                                    disabled
                                                    v-if="formOption.formData.standard"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productionType"
                                                    placeholder="(C60/C80/C61/C81..)">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.inventoryType">{{item.inventoryType}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="产出量(kg)" prop="totalOutputAmount" :rules="{required:true,trigger:'blur',message:'产出量不能为空'}">
                                                <a-input-number
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.totalOutputAmount"
                                                    placeholder="产出量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                    <div v-if="tabName =='大袋外包'">
                        <div class="table">
                            <a-card hoverable>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="日期">
                                                <a-popover title="日期来源">
                                                    <a-icon type="question-circle" style="color: #b10b0b;font-size: 18px" />*
                                                    <template slot="content">
                                                        <h4>日期来源于大袋分装表日期</h4>
                                                    </template>
                                                </a-popover>
                                                <span>{{date}}</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="标准" prop="standard">
                                                <a-select
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    disabled
                                                    allowClear
                                                    v-model="formOption.formData.standard"
                                                    @change="standardChange"
                                                    placeholder="选择标准">
                                                    <a-select-option value="国标">国标</a-select-option>
                                                    <a-select-option value="省标">省标</a-select-option>
                                                    <a-select-option value="省标-北京">省标-北京</a-select-option>
                                                    <a-select-option value="省标-上海">省标-上海</a-select-option>
                                                    <!--                                                <a-select-option value="国标-北京">国标-北京</a-select-option>-->
                                                </a-select>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="品名" prop="productName">
                                                <a-select
                                                    v-if="formOption.formData.standard"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    disabled
                                                    allowClear
                                                    v-model="formOption.formData.productName"
                                                    placeholder="选择品名">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.name">{{item.name}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="房间编号" prop="roomNumber">
                                                <a-input allowClear class="inputs" v-model="formOption.formData.roomNumber" placeholder="房间编号"></a-input>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                                <div class="tool-bar">
                                    <a-row>
                                        <a-col :span="6">
                                            <a-form-model-item label="批号" prop="batchNumber">
                                                <a-select
                                                    v-if="formOption.formData.standard && formOption.formData.productName"
                                                    show-search
                                                    :filter-option="$filterOption"
                                                    class="inputs"
                                                    disabled
                                                    allowClear
                                                    v-model="formOption.formData.batchNumber"
                                                    @change="batchChangeOfPacking"
                                                    placeholder="选择批号">
                                                    <a-select-option v-for="(item,i) in searchSource.codeList" :key="i" :value="item.finishedProductBatchNumber">{{item.finishedProductBatchNumber}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准和品名</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="生产类型" prop="productionType">
                                                <a-select
                                                    disabled
                                                    v-if="formOption.formData.standard"
                                                    class="inputs"
                                                    allowClear
                                                    v-model="formOption.formData.productionType"
                                                    placeholder="(C60/C80/C61/C81..)">
                                                    <a-select-option v-for="(item,i) in searchSource.productList" :key="i" :value="item.inventoryType">{{item.inventoryType}}</a-select-option>
                                                </a-select>
                                                <span v-else>请先选择标准</span>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="成品量(kg)" prop="finishedProductNumber" :rules="{required:true,trigger:'blur',message:'成品量不能为空'}">
                                                <a-input-number class="inputs" allowClear v-model="formOption.formData.finishedProductNumber" placeholder="成品量(kg)"></a-input-number>
                                            </a-form-model-item>
                                        </a-col>
                                        <a-col :span="6">
                                            <a-form-model-item label="备注" prop="remarks">
                                                <a-textarea :rows="2" class="inputs" v-model="formOption.formData.remarks" placeholder="备注"></a-textarea>
                                            </a-form-model-item>
                                        </a-col>
                                    </a-row>
                                </div>
                            </a-card>
                        </div>
                    </div>
                </a-form-model>
            </div>
            <div slot="footer" style="text-align: center">
                <a-button size="large" @click="modalOption.onCancel">取 消</a-button>
                <a-button size="large" type="primary" @click="modalOption.onOk">确 定</a-button>
            </div>
        </a-spin>
    </a-modal>
</template>
<script lang="ts">
import {Component, Prop, Vue, Watch} from "vue-property-decorator";
import locale from "ant-design-vue/lib/date-picker/locale/zh_CN";
import nextApi from "@/api/nextApi";
import areaJson from "@/utils/area";
import { message } from "ant-design-vue";

@Component({})
export default class extends Vue {
    @Prop({ default: false }) visible!: boolean;
    @Prop({ default: "" }) editId!: string;
    @Prop({ default: "" }) type!: string;
    @Prop({ default: "" }) materialType!: string;
    @Prop({ default: "" }) tabName!: string;
    @Watch("visible")
    visibleChange(val) {
        if (val) {
            this.searchSource.addrData = areaJson;
            console.log(this.formOption.formData)
        }else{
            //关闭弹窗初始化数据组
            this.searchSource = {
                memberList:[],//人员列表
                productList:[],//产品列表
                addrData:[],//地区列表
                accessoriesList:[],//辅料列表
                originMaterialList:[],//根据类型获取到的原料列表
                codeList:[],//装各种批号 例如：查询的前处理的来料批号,查询的提取的批号
                standardList:[],//标准列表
                rawMedSerialNumList:[],//原药材流水号列表
                originOfProdList:[],//产地列表
            }
            this.formOption.formData = {
                rawMaterialName:undefined,//由于清空品名和原药材名称，需要清空关联的下拉框，所以需要初始值
                origin:undefined,
                rawMaterialSerialNumber:[''],
                productName:'',//由于小袋分装的品名需要根据标准和生产类型来进一步查询，所以需要默认值否则下拉框无法选择
                specification:'',//由于小袋分装的规格和装量需要品名列表和生产类型来回填，所以需要默认值否则下拉框无法回填
                loadingQuantity:'',//由于小袋分装的装量需要品名列表和生产类型来回填，所以需要默认值否则下拉框无法回填
                inputAmount:0,//由于提取选择来料批号要计算投料量，所以需要默认值，否则页面数据未及时更新视图层
                totalOutputAmount:0,//由于混一开启aps获取产出量，所以需要默认值，否则页面数据未及时更新视图层
                batchNumber:'',//由于混一关闭aps清除批号，所以需要默认值，否则页面数据未及时更新视图层
                incomingBatchNumber:'',//由于混二开启aps需要选择来料批号，所以需要默认值，否则页面数据未及时更新视图层
                auxiliaryMaterialNameTwo:[{name:'',value:''}],
                dryAuxiliaryMaterials:[{name:'',value:''}],//喷干辅料
                mixTwoAuxiliaryMaterials:[{name:'',value:''}],//混二辅料
            }
        }
    }
    @Watch("editId",{immediate:true})
    editIdChange(val) {
        if (val) {
            console.log('id:',val)
            this.modalOption.title = `编辑-${this.tabName}`;
            this.getInfo()
        }else{
            this.modalOption.title = `新增-${this.tabName}`;
        }
    }
    @Watch('tabName')
    tabNameChange(){
        this.editIdChange(this.editId)
    }
    //组件配置
    locale = locale;
    modalOption: any = {
        width: "90%",
        title: "新增",
        okText: "保存",
        cancelText: "取消",
        loading: false,
        onOk: () => {
            this.modalOk();
        },
        onCancel: () => {
            this.closeModal();
        },
    };
    date: string = '';
    loading:boolean = false;
    //表单数据源
    searchSource:any = {
        memberList:[],//人员列表
        productList:[],//产品列表
        addrData:[],//地区列表
        accessoriesList:[],//辅料列表
        originMaterialList:[],//根据类型获取到的原料列表
        codeList:[],//装各种批号 例如：查询的前处理的来料批号,查询的提取的批号
        standardList:[],//标准列表
        rawMedSerialNumList:[],//原药材流水号列表
        originOfProdList:[],//产地列表

        productionTypeList:[],//大小袋分装专用生产类型数据源
    }
    //表单配置
    formOption: any = {
        labelCol: { style: { width: "140px" } },
        wrapperCol: { style: {width:'calc(100% - 140px)'}},
        layout: "inline",
        labelAlign: "right",
        hideRequiredMark: false,
        formData: {
            rawMaterialName:undefined,//由于清空品名和原药材名称，需要清空下拉框，所以需要初始值
            origin:undefined,
            rawMaterialSerialNumber:[''],
            productName:'',//由于小袋分装的品名需要根据标准和生产类型来进一步查询，所以需要默认值否则下拉框无法选择
            specification:'',//由于小袋分装的规格和装量需要品名列表和生产类型来回填，所以需要默认值否则下拉框无法回填
            loadingQuantity:'',//由于小袋分装的装量需要品名列表和生产类型来回填，所以需要默认值否则下拉框无法回填
            inputAmount:0,//由于提取选择来料批号要计算投料量，所以需要默认值，否则页面数据未及时更新视图层
            totalOutputAmount:0,//由于混一开启aps获取产出量，所以需要默认值，否则页面数据未及时更新视图层
            batchNumber:'',//由于混一关闭aps清除批号，所以需要默认值，否则页面数据未及时更新视图层
            incomingBatchNumber:'',//由于混二开启aps需要选择来料批号，所以需要默认值，否则页面数据未及时更新视图层
            auxiliaryMaterialNameTwo:[{
                name:'',
                value:''
            }],
            dryAuxiliaryMaterials:[{name:'',value:''}],//喷干辅料
            mixTwoAuxiliaryMaterials:[{name:'',value:''}],//混二辅料
        },
        rules: {},
    };

    /**
     * @description 处理一些数据的方法
     *  **/
    //前处理辅料新增
    addAuxiliaryMaterialNameTwo(){
        this.formOption.formData.auxiliaryMaterialNameTwo.push({
            name:'',
            value:''
        })
    }
    //前处理辅料删除
    delAuxiliaryMaterialNameTwo(idx){
        this.formOption.formData.auxiliaryMaterialNameTwo.splice(idx,1)
    }
    //喷干辅料新增
    addDryAuxiliaryMaterials(){
        this.formOption.formData.dryAuxiliaryMaterials.push({
            name:'',
            value:''
        })
    }
    //喷干辅料删除
    delDryAuxiliaryMaterials(idx){
        this.formOption.formData.dryAuxiliaryMaterials.splice(idx,1)
    }
    //混二辅料新增
    addMixTwoAuxiliaryMaterials(){
        this.formOption.formData.mixTwoAuxiliaryMaterials.push({
            name:'',
            value:''
        })
    }
    //混二辅料删除
    delMixTwoAuxiliaryMaterials(idx){
        this.formOption.formData.mixTwoAuxiliaryMaterials.splice(idx,1)
    }
    //查询详情后进行修改
    async getInfo(){
        const res = await nextApi.getProductionTableList({id:this.editId})
        this.formOption.formData = res.data
        //手动选择日期的需要回填日期 2025/5/28
        if(this.formOption.formData.productionDate){
            this.date = this.formOption.formData.productionDate
        }
        if(this.formOption.formData.auxiliaryMaterialNameTwo){
            this.formOption.formData.auxiliaryMaterialNameTwo = JSON.parse(this.formOption.formData.auxiliaryMaterialNameTwo)
        }
        if(this.formOption.formData.equipment){
            this.formOption.formData.equipment = JSON.parse(this.formOption.formData.equipment)
        }
        if(this.formOption.formData.process){
            this.formOption.formData.process = JSON.parse(this.formOption.formData.process)
        }
        if(this.formOption.formData.process == null){
            this.formOption.formData.process = []
        }
        if(this.formOption.formData.equipment == null){
            this.formOption.formData.equipment = []
        }
        if(this.formOption.formData.operator == null){
            this.formOption.formData.operator = []
        }
        if(this.formOption.formData.process == null){
            this.formOption.formData.process = []
        }
        if(this.formOption.formData.swingPackStaffJson == null){
            this.formOption.formData.swingPackStaffJson = []
        }
        if(this.formOption.formData.bagInBagStaffJson == null){
            this.formOption.formData.bagInBagStaffJson = []
        }
        //喷干辅料查询
        if(this.formOption.formData.dryAuxiliaryMaterials){
            console.log(this.formOption.formData.dryAuxiliaryMaterials);
            this.formOption.formData.dryAuxiliaryMaterials = JSON.parse(this.formOption.formData.dryAuxiliaryMaterials)
        }
        //混二辅料查询
        if(this.formOption.formData.mixTwoAuxiliaryMaterials){
            this.formOption.formData.mixTwoAuxiliaryMaterials = JSON.parse(this.formOption.formData.mixTwoAuxiliaryMaterials)
        }
        await this.standardChange(this.formOption.formData.standard,false)
        this.$nextTick(()=>{
            this.productNameChange(this.formOption.formData.productName)
        })
        console.log(res)
    }
    //提交
    modalOk(){
        (this.$refs.formModel as any).validate(async (valid: boolean) => {
            if (valid) {
                this.modalOption.loading = true;
                try {
                    this.formOption.formData.productionDate = this.date
                    this.formOption.formData.type = this.tabName
                    let params = JSON.stringify(this.formOption.formData)
                    let temp = JSON.parse(params)
                    temp.auxiliaryMaterialNameTwo = temp.auxiliaryMaterialNameTwo ? JSON.stringify(temp.auxiliaryMaterialNameTwo):null
                    temp.dryAuxiliaryMaterials = temp.dryAuxiliaryMaterials ? JSON.stringify(temp.dryAuxiliaryMaterials):null
                    temp.mixTwoAuxiliaryMaterials = temp.mixTwoAuxiliaryMaterials ? JSON.stringify(temp.mixTwoAuxiliaryMaterials):null
                    temp.equipment = temp.equipment ? JSON.stringify(temp.equipment):null
                    temp.process = temp.process ? JSON.stringify(temp.process):null
                    temp.rawMaterialSerialNumber = temp.rawMaterialSerialNumber ? JSON.stringify(temp.rawMaterialSerialNumber):null
                    temp.operator = temp.operator ? JSON.stringify(temp.operator):null
                    temp.materialBatchNumber = temp.materialBatchNumber ? JSON.stringify(temp.materialBatchNumber):null
                    console.log('表单数据：',temp)
                    const res = await nextApi.addTable(temp)
                    if(res.code === 200){
                        this.$message.success(res.msg)
                        this.$emit("closeModal")
                    }
                }finally {
                    this.modalOption.loading = false;
                }
            }
        });
    }
    //选择标准
    async standardChange(v,removeFlag = true){
        if(removeFlag){
            this.formOption.formData.productName = undefined
            this.formOption.formData.rawMaterialName = undefined
        }
        if(v){
            this.loading = true
            if(this.tabName == '前处理'){
                await this.getMemberData()
                await this.getProductData(this.type,this.materialType,'productList')
                await this.getOriginalMedicineData('辅料','accessoriesList')
                // await this.getPlanDetail(this.tabName,'饮片计划')

                //TODO 由于第三次大改动 暂时将原药材流水号数据来源改为假数据 2025/5/28
            this.searchSource.rawMedSerialNumList = [{batch:'1234(testing)'},{batch:'3214(testing)'}]
            }else if(this.tabName == '提取'){
                await this.getMemberData()
                await this.getProductData(this.type,this.materialType,'productList')
                // await this.getPlanDetail(this.tabName,'提取计划')
            }else if(this.tabName == '喷干'){
                await this.getMemberData()
                await this.getProductData(this.type,this.materialType,'productList')
                await this.getOriginalMedicineData('辅料','accessoriesList')
                // await this.getTableDataByTabName('提取')
                // await this.getPlanDetail(this.tabName,'提取计划')
                // await this.getBatchData()
            }else if(this.tabName == '过筛'){
                await this.getProductData(this.type,this.materialType,'productList')
                await this.getTableDataByTabName('提取')
                // await this.getPlanDetail(this.tabName,'提取计划')
                // await this.getBatchData()
            }else if(this.tabName == '混一') {
                await this.getMemberData()
                await this.getProductData(this.type, this.materialType, 'productList')
                await this.getTableDataByTabName('提取')
                await this.getOriginalMedicineData('辅料','accessoriesList')
                // await this.getPlanDetail(this.tabName,'提取计划')
                // await this.getBatchData()
                let find = this.searchSource.codeList.find(item=>item.batchNumber === this.formOption.formData.batchNumber)
                if(find){
                    this.formOption.formData.incomingBatchNumber = find.batchNumber
                }
            }else if(this.tabName == '混二'){
                await this.getMemberData()
                await this.getProductData(this.type, this.materialType, 'productList')
                await this.getTableDataByTabName('混一')
                await this.getOriginalMedicineData('辅料','accessoriesList')
                // await this.getPlanDetail(this.tabName,'制剂计划')
                // await this.getBatchData()
            }else if(this.tabName == '制粒'){
                await this.getMemberData()
                await this.getProductData(this.type,this.materialType,'productList')
                await this.getTableDataByTabName('混二')
                // await this.getPlanDetail(this.tabName,'制剂计划')
            }else if(this.tabName == '小袋分装'){
                await this.getMemberData()
                await this.getProductData(this.type,this.materialType,'productList','','小袋')
                await this.getProductData(this.type,this.materialType,'productionTypeList','','小袋')
                //去重将当前标准下的产品列表中的产品大类筛选
                this.searchSource.productionTypeList = [...new Map(this.searchSource.productionTypeList.map(item=>[item.inventoryType,item])).values()]
                await this.getTableDataByTabName('制粒')
                // await this.getPlanDetail(this.tabName,'包装计划',this.formOption.formData.productionType)
            }else if(this.tabName == '大袋分装'){
                await this.getMemberData()
                await this.getProductData(this.type,this.materialType,'productList','','大袋')
                await this.getProductData(this.type,this.materialType,'productionTypeList','','大袋')
                //去重将当前标准下的产品列表中的产品大类筛选
                this.searchSource.productionTypeList = [...new Map(this.searchSource.productionTypeList.map(item=>[item.inventoryType,item])).values()]
                await this.getProductData(this.type,this.materialType,'standardList')
                await this.getTableDataByTabName('制粒')
                // await this.getPlanDetail(this.tabName,'包装计划',this.formOption.formData.productionType)
            }else if(this.tabName == '小袋外包'){
                await this.getProductData(this.type,this.materialType,'productList')
                await this.getTableDataByTabName('小袋分装')
                // await this.getPlanDetail(this.tabName,'包装计划',this.formOption.formData.productionType)
            }else if(this.tabName == '大袋外包'){
                await this.getProductData(this.type,this.materialType,'productList')
                await this.getTableDataByTabName('大袋分装')
                console.log(this.searchSource.codeList,'$$$$')
                // await this.getPlanDetail(this.tabName,'包装计划',this.formOption.formData.productionType)

            }
        } else{
            this.searchSource = {
                memberList:[],//人员列表
                productList:[],//产品列表
                addrData:[],//地区列表
                accessoriesList:[],//辅料列表
                originMaterialList:[],//根据类型获取到的原料列表
                codeList:[],//装各种批号 例如：查询的前处理的来料批号,查询的提取的批号
                standardList:[],//标准列表
            }
        }
        this.loading = false
    }
    //选择品名
    async productNameChange(v){
        console.log('change:',v)
        let find = this.searchSource.productList.find(item=>item.name === v)
        console.log(find);
        
        if(find){
            await this.getMaterialData(find.id,'originMaterialList')
            this.formOption.formData.notice = find.notice//获取当前原药材名的药材备注
        }else{
            this.searchSource.originMaterialList = []
        }
        //将产品管理中查询到的列表选择产品名称后带入查询前处理列表数据来筛选前处理对应的批号 2025/5/28
        if(this.tabName==='提取'){
            await this.getTableDataByTabName('前处理',find.materialName)
        }
        if(this.tabName==='小袋分装'){
            if(!v) this.formOption.formData.productName = undefined
            await this.getProductData(this.type,this.materialType,'productList',this.formOption.formData.productionType)
            let find = this.searchSource.productList.find(item=>item.name === v)
            console.log(find)
            this.$nextTick(()=>{
                if(find){
                    this.formOption.formData.specification = find.spec
                    this.formOption.formData.loadingQuantity = find.loadingQuantity
                }else{
                    this.formOption.formData.specification = ''
                    this.formOption.formData.loadingQuantity = ''
                }
                
            })
        }
        if(this.tabName==='大袋分装'){
            if(!v) this.formOption.formData.productName = undefined
            await this.getProductData(this.type,this.materialType,'productList',this.formOption.formData.productionType)
            let find = this.searchSource.productList.find(item=>item.name === v)
            console.log(find)
            this.$nextTick(()=>{
                if(find){
                    this.formOption.formData.specification = find.spec
                    this.formOption.formData.loadingQuantity = find.loadingQuantity
                }else{
                    this.formOption.formData.specification = ''
                    this.formOption.formData.loadingQuantity = ''
                }
                
            })
        }
        //混二选择品名时来料批号列表确定唯一
        if(this.tabName === '混二'){
            let saveProductName = this.formOption.formData.productName
            if(this.searchSource.codeList.length<=1){
                await this.getTableDataByTabName('混一')
                this.formOption.formData.productName = saveProductName
            }
            //取当前找到对象的materialName和混一列表的productName对比，然后取批号
            let prodcutFind = this.searchSource.productList.find(item=>item.name === v)
            if(prodcutFind){
                let mixOneFind = this.searchSource.codeList.find(item=>item.productName===prodcutFind.materialName)
                if(mixOneFind){
                    this.searchSource.codeList = [mixOneFind]
                }else{
                    this.searchSource.codeList = []
                }
            }
        }
    }
    //原药材品名选择
    rawMaterialNameChange(v){
        console.log(v)
        this.formOption.formData.origin = undefined
        let find = this.searchSource.originMaterialList.find(item=>item.name === v && item.materialType === '中药材')
        if(find && find.prodAddress){
            this.searchSource.originOfProdList = JSON.parse(find.prodAddress)
        }
    }
    //混一批次选择
    mixOneBatchChange(v){
        this.formOption.formData.incomingBatchNumber = v
        let find = this.searchSource.codeList.find(item=>item.batchNumber === v)
        if(find){
            this.formOption.formData.materialCode = find.materialCode
            this.formOption.formData.productionType = find.productionType
            this.formOption.formData.productionSerialNumber = find.productionSerialNumber
        }
    }
    //混二批次选择
    mixTwoBatchChange(v){
        let find = this.searchSource.codeList.find(item=>item.batchNumber === v)
        if(find){
            this.formOption.formData.inputAmount = find.inputNum
            this.formOption.formData.materialCode = find.materialCode
            this.formOption.formData.productionType = find.productionType
            this.formOption.formData.productionSerialNumber = find.productionSerialNumber
        }
    }
    //批号选择
    batchChange(v){
        let find = this.searchSource.codeList.find(item=>item.batchNumber === v)
        if(find){
            this.formOption.formData.materialCode = find.materialCode
            this.formOption.formData.productionType = find.productionType
            this.formOption.formData.productionSerialNumber = find.productionSerialNumber
        }
    }
    //制粒生产批号选择
    productionBatchChange(v){
        let find = this.searchSource.codeList.find(item=>item.batchNumber === v)
        if(find){
            this.formOption.formData.materialCode = find.materialCode
            this.formOption.formData.batchNumber = find.materialCode+find.productionSerialNumber
            this.formOption.formData.secondBatch = find.secondBatch
            this.formOption.formData.productionSerialNumber = find.productionSerialNumber
            this.formOption.formData.productionType = find.productionType
        }
    }
    //大小袋分装生产类型选择
    async productionTypeChange(spec,v,withoutSpec){
        console.log(v,withoutSpec);
        
        if(!v) this.formOption.formData.productName = undefined
        await this.getProductData(this.type,this.materialType,'productList',this.formOption.formData.productionType)
        await this.getProductData(spec,this.type,this.materialType,'standardList')
        let find = this.searchSource.standardList.find(item=>item.inventoryType === v)
        console.log(find)
        this.$nextTick(()=>{
            if(find && withoutSpec == 'yes'){
                this.formOption.formData.loadingQuantity = find.loadingQuantity
            }else if(find){
                this.formOption.formData.specification = find.spec
                this.formOption.formData.loadingQuantity = find.loadingQuantity
            }else if(!find && withoutSpec == 'yes'){
                this.formOption.formData.loadingQuantity = ''
            }else{
                this.formOption.formData.specification = ''
                this.formOption.formData.loadingQuantity = ''
            }
        })
    }
    //大小袋外包批号选择
    batchChangeOfPacking(v){
        console.log(v)
        let find = this.searchSource.codeList.find(item=>item.finishedProductBatchNumber === v)
        console.log(find)
        if(find){
            this.formOption.formData.productionType = find.productionType
        }else{
            this.formOption.formData.inventoryType = ''
        }
    }
    //获取对应计划中的投料信息
    async getPlanDetail(tabName,name,inventoryType?){
        let params = {
            name:this.formOption.formData.productName,
            standard:this.formOption.formData.standard,
            planName:name,
            inventoryType
        }
        const res = await nextApi.getPlanDetail(params)
        // this.date = res.data.createTime || []
        if(tabName == '前处理'){
            this.formOption.formData.totalInputAmount = res.data.inputNum
            this.formOption.formData.totalOutputAmount = res.data.prodNum
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.rawMaterialSerialNumber = res.data.inputBatch?.split(',')
            this.searchSource.rawMedSerialNumList = res.data.inputBatch?.split(',')
        }else if(tabName == '提取'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.materialBatchNumber = res.data.inputBatch?.split(',')
            this.formOption.formData.inputAmount = res.data.inputNum
        }else if(tabName == '喷干'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
        }else if(tabName == '过筛'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
        }else if(tabName == '混一'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.totalOutputAmount = res.data.prodNum
            let find = this.searchSource.codeList.find(item=>item.productName === this.formOption.formData.productName)
            if(find){
                this.formOption.formData.incomingBatchNumber = find.batchNumber
            }
        }else if(tabName == '混二'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.inputAmount = res.data.inputNum
            this.formOption.formData.incomingBatchNumber = res.data.inputBatch
        }else if(tabName == '制粒'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.incomingBatchNumber = res.data.inputBatch
            this.formOption.formData.totalOutputAmount = res.data.prodNum
        }else if(tabName == '小袋分装'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.productionType = res.data.inventoryType
            this.formOption.formData.specification = res.data.spec
            this.formOption.formData.loadingQuantity = res.data.loadingQuantity
            this.formOption.formData.incomingBatchNumber = res.data.inputBatch
        }else if(tabName == '大袋分装'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.productionType = res.data.inventoryType
            this.formOption.formData.loadingQuantity = res.data.loadingQuantity
            this.formOption.formData.incomingBatchNumber = res.data.inputBatch
        }else if(tabName == '小袋外包'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.productionType = res.data.inventoryType
            this.formOption.formData.totalOutputAmount = res.data.prodNum
            //根据详情中的productName和productionType来筛选批号列表中符合的
            let result = this.searchSource.codeList.filter(item=>{
                if(item.productName == this.formOption.formData.productName && item.productionType == this.formOption.formData.productionType){
                    return item
                }
            })
            this.formOption.formData.batchNumber = result[0].finishedProductBatchNumber
        }else if(tabName == '大袋外包'){
            this.formOption.formData.standard = res.data.standard
            this.formOption.formData.productName = res.data.prodName
            this.formOption.formData.productionType = res.data.inventoryType
            //根据详情中的productName和productionType来筛选批号列表中符合的
            let result = this.searchSource.codeList.filter(item=>{
                if(item.productName == this.formOption.formData.productName && item.productionType == this.formOption.formData.productionType){
                    return item
                }
            })
            this.formOption.formData.batchNumber = result[0].finishedProductBatchNumber
        }

    }
    //根据当前表单的品名来筛选出前一流程中的批号
    async getBatchData(){
        let find = this.searchSource.codeList.find(item=>item.productName === this.formOption.formData.productName)
        if(find){
            this.formOption.formData.batchNumber = find.batchNumber
            this.batchChange(this.formOption.formData.batchNumber)
        }
    }
    //获取人员管理列表
    async getMemberData(){
        let params = {
            organizationId:'3a3bafbe4be36ca7fa9858b55687de4b',
            pageSize: 1000,
            pageNum: 1,
        }
        const res = await nextApi.getAccountList(params)
        this.searchSource.memberList = res.data.rows || []
    }
    /**
     * @description 根据tabName查询表数据 表单中有些数据（特别是批号）依赖于其他tabName的表数据所以查询该接口
     * @params type 查询的tabName
     * **/
    async getTableDataByTabName(type,productName?){
        let params = {
            productName,
            type,
            pageNum: 1,
            pageSize: 1000,
        }
        const res = await nextApi.getProductionTableList(params)
        this.searchSource.codeList = res?.data?.rows || []
        //去重
        // this.searchSource.codeList = this.searchSource.codeList.filter((item,index,arr)=>{
        //     return arr.findIndex(it=>it.batchNumber === item.batchNumber) === index
        // })
    }
    /**
     * @description 根据产品类型获取该类型下的物料列表 但是这里只查最开始的中药材
     * @params type 产品类型 - 配方颗粒 配方颗粒(颗粒) 提取物 饮片 中药材
     * @params filedName 表单数据源字段名
     * **/
    async getMaterialData(id,filedName){
        const res = await nextApi.getOriginMaterialListById({id})
        let data
        data = res.data
        let arr = data.filter(item=>item.materialType == '中药材')
        this.searchSource[filedName] = arr || []
    }
    /**
     * @description 获取产品列表
     * @params spec 规格 - 大袋 小袋
     * @params type 产品类型 - 半成品 成品 待包装成品
     * @params materialType 半成品小类 - 提取物 饮片
     * @params inventoryType 产品大类 - C60....
     * @params filedName 表单数据源字段名
     * **/
    async getProductData(type?,materialType?,filedName?,inventoryType?,spec?){
        let params = {
            spec,
            type,
            inventoryType,
            materialType,
            standard:this.formOption.formData.standard,
            pageNum: 1,
            pageSize: 10000,
            state:true
        }
        const res = await nextApi.getMaterialList(params)
        this.searchSource[filedName] = res.data.records || []
        if(filedName == 'standardList'){
            //去重并保留对象中的所有数据
            this.searchSource.standardList = [...new Map(this.searchSource.standardList.map(item=>[item.inventoryType,item])).values()]
        }
    }
    /**
     * @description 获取物料列表
     * @params materialType 物料类型
     * @params filedName 表单数据源字段名
     * **/
    async getOriginalMedicineData(materialType,filedName,standard?){
        let params = {
            materialType,
            standard,
            pageNum: 1,
            pageSize: 10000,
            state:true
        }
        const res = await nextApi.getMaterialList(params)
        this.searchSource[filedName] = res.data.records || []
    }
    closeModal() {
        this.$emit("closeModal");
    }

    /**
     * @description 计算属性
     * **/
    get rawMaterialBatchNumber(){
        if(this.formOption.formData.rawMaterialClassificationCode && this.formOption.formData.materialCode && this.formOption.formData.rawMaterialSerialNumber){
            this.formOption.formData.rawMaterialBatchNumber = (this.formOption.formData.rawMaterialClassificationCode)+''
                +(this.formOption.formData.materialCode)+'-'
                +(this.formOption.formData.rawMaterialSerialNumber)+''
            return (this.formOption.formData.rawMaterialClassificationCode)+''
                +(this.formOption.formData.materialCode)+'-'
                +(this.formOption.formData.rawMaterialSerialNumber)+''
        }
    }
    get batchNumber(){
        if(this.formOption.formData.productionType && this.formOption.formData.materialCode && this.formOption.formData.productionSerialNumber && this.formOption.formData.preDealBatch){
            this.formOption.formData.batchNumber = (this.formOption.formData.productionType)+''
                +(this.formOption.formData.materialCode)+''
                +(this.formOption.formData.productionSerialNumber)+''
                +(this.formOption.formData.preDealBatch)
            return this.formOption.formData.batchNumber
        }
    }
    get batchNumberOfExtract(){
        if(this.formOption.formData.productionType && this.formOption.formData.materialCode && this.formOption.formData.productionSerialNumber){
            this.formOption.formData.batchNumber = (this.formOption.formData.productionType)+''
                +(this.formOption.formData.materialCode)+''
                +(this.formOption.formData.productionSerialNumber)+''
            return this.formOption.formData.batchNumber
        }
    }
    get workingHours(){
        let {startTime,actualProductionTime,clearingTime,personnel} = this.formOption.formData
        if(startTime && actualProductionTime && personnel){
            this.formOption.formData.workingHours = (startTime+actualProductionTime+clearingTime)*personnel
            return this.formOption.formData.workingHours
        }
    }
    get secondBatchNumber(){
        let {batchNumber,secondBatch} = this.formOption.formData
        if(batchNumber && secondBatch){
            this.formOption.formData.secondBatchNumber = batchNumber+secondBatch
            return this.formOption.formData.secondBatchNumber
        }
    }
    get loss(){
        let {coarsePowderAmount,totalOutputAmount} = this.formOption.formData
        if(coarsePowderAmount && totalOutputAmount){
            this.formOption.formData.loss = coarsePowderAmount-totalOutputAmount
            this.formOption.formData.loss == 0 ? this.formOption.formData.loss = '0' : this.formOption.formData.loss
            return this.formOption.formData.loss
        }
    }
    get batchNumberOfMixTwo(){
        let {incomingBatchNumber,secondBatch} = this.formOption.formData
        if(incomingBatchNumber && secondBatch){
            this.formOption.formData.batchNumber = incomingBatchNumber+secondBatch
            return this.formOption.formData.batchNumber
        }
    }
    get zlBatchNumber(){
        let {materialCode,productionSerialNumber} = this.formOption.formData
        if(materialCode && productionSerialNumber){
            this.formOption.formData.batchNumber = materialCode+productionSerialNumber
            return this.formOption.formData.batchNumber
        }
    }
}
</script>
<style scoped lang="scss">
.container {
    padding: 0;
    .MR-10 {
        margin-right: 10px;
    }
    .inputs {
        width: 200px;
    }
    .inputs-with-qus{
        width: 173px;
    }
    .tool-bar {
        margin-bottom: 20px;

    }
    .table {
        margin-top: 20px;
    }
}
</style>
